﻿#region Using Statements
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Input;
#endregion

namespace RhinoXNA
{
    public class PlayerCamera
    {
        private Vector3 _pos;
        private Vector3 _lookAt;
        
        private float scrollValue;

        public Vector3 Position 
        {
            get { return _pos; }
            set { _pos = value; }
        }

        public Vector3 LookAt
        {
            get { return _lookAt; }
        }

        public PlayerCamera(Vector3 position, Vector3 lookAt)
        {
            _lookAt = lookAt;
            _pos = position;

            scrollValue = Mouse.GetState().ScrollWheelValue;
        }

        public void MoveCamera(Vector3 movement) 
        {
            _pos += movement;
            _lookAt += movement;
        }

        public void Update()
        {
            float currValue = Mouse.GetState().ScrollWheelValue;

            //if ((MathHelper.Distance(Player.Position.Z, _pos.Z) > 30.0f && ((currValue - scrollValue) * 0.1f) > 0)
            // && (MathHelper.Distance(Player.Position.Z, _pos.Z) < 500.0f)
            //    )
            //{
                _pos.Z -= ((currValue - scrollValue) * 0.1f);
                scrollValue = currValue;
            //}

            //else
            //{
            //    currValue = scrollValue;
            //}

            //scrollValue = currValue;
        }
    }
}
